package com.tingyuge.base.thread.wang.chapter6;

/**
 * 如果线程是在通信如何打断..
 */
public class ThreadCloseForce {

    public static class Worker extends Thread{
        private volatile boolean start = true;

        @Override
        public void run() {
            while (start){
                //connection...
            }
        }

    }

    public static void main(String[] args) {
       Worker worker = new Worker();
        worker.start();
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();

        }


    }
}
